<template>
  <section class="component num-type-select">
    <el-select v-model="numType" @change="onNumTypeChange" size="mini">
      <el-option label="按金额" :value="0"></el-option>
      <el-option label="按户数" :value="1"></el-option>
    </el-select>
  </section>
</template>

<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { Layout, Dependencies } from "~/core/decorator";
import { Watch, Prop, Emit, Model } from "vue-property-decorator";

@Component({
  components: {}
})
export default class NumTypeSelect extends Vue {
  @Model("updateNumType")
  private currentNumType;

  @Emit("updateNumType")
  private updateNumType(type) { }

  @Emit("onNumTypeChange")
  private emitNumTypeChange(type) { }

  private get numType() {
    return this.currentNumType;
  }

  private set numType(val) {
    this.updateNumType(val);
  }

  private onNumTypeChange() {
    this.emitNumTypeChange(this.numType);
  }
}
</script>

<style lang="less">
</style>
